package ex_innerclass;

public class InnerClass {
	CarName carName;
	String color;
	
	class CarName {
		String model;
		int year;
		
		CarName(String model, int year) {
			this.model = model;
			this.year = year;
		}
		
		void outColor() {
			System.out.println("색상은 " + color + "입니다.");
		}
	}
	
	InnerClass(String model, int year, String color) {
		carName = new CarName(model, year);
		this.color = color;
	}
	
	void outInfo() {
		System.out.printf("모델 : %s, 년식 : %d, 색상 : %s\n",
				carName.model, carName.year, color);
	}
	
}
